package com.yj.springbootaop.staticproxy;

/**
 * 代理对象
 * 需要和原始对象实现相同的接口
 */
public class SmsServiceProxy implements SmsService {

    // 原始对象
    private SmsServiceImpl smsService;

    public SmsServiceProxy(SmsServiceImpl smsService){
        this.smsService = smsService;
    }

    @Override
    public void send(String msg) {
        System.out.println("before msg send!");
        smsService.send(msg);
        System.out.println("after msg send!");
    }
}
